// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
abstract contract AbstractContract {
function someFunction() public pure returns(string memory) {
return “some message”;
}
}
Now, after compiling, try to deploy and run any of the preceding two
contracts and you will find the error message “This contract may be
abstract, and does not implement an abstract parent’s methods
completely or invoke an inherited contract’s constructor correctly.”
Now, let’s add another contract to the same file and implement the
same. Refer to the following code:
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
abstract contract AbstractContract {
function someFunction() public pure virtual returns(string
memory);
}
contract ImplementorContract is AbstractContract {
function someFunction() public override pure returns(string
memory) {
return “some message”;
}
}
You can find an “override” keyword that marks that the function in the
ImplementorContract is overriding a function in the AbstractContract.
Now, again we can compile it and deploy the second contract by
choosing the one from the REMIX browser’s list of contracts, and
finally run this without any issue.
2.5.21.2 Interface